﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Expo.Training.DataAccess.Activity;

public partial class Activity_AddRegistration : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btn_Add_Click(object sender, EventArgs e)
    {
        Guid _activityId = new Guid(this.txtActivityID.Text.Trim());
        Guid _memberId = this.Member.MemberID;
        DateTime _addTime = DateTime.Now;
        string _realName = "张三";
        int _sex = 1;
        int _age = 60;
        string _familyAddress = "慈溪市";
        string _contactAddress = "上海市";
        string _mobile = "13318881888";
        DateTime _beginDate = DateTime.Now;
        DateTime _endDate = DateTime.Now.AddDays(5);
        string _intention = "巴马";
        string _requirement = "无";
        int _regNumber = 1;
        string _comments = "无";
        int _status = 1;

        ActivityRegistrationEntity _model = new ActivityRegistrationEntity();
        _model.ActivityID = _activityId;
        _model.MemberID = _memberId;
        _model.AddTime = _addTime;
        _model.RealName = _realName;
        _model.Sex = _sex;
        _model.Age = _age;
        _model.FamilyAddress = _familyAddress;
        _model.ContactAddres = _contactAddress;
        _model.Mobile = _mobile;
        _model.BeginDate = _beginDate;
        _model.EndDate = _endDate;
        _model.Intention = _intention;
        _model.Requirement = _requirement;
        _model.RegNumber = _regNumber;
        _model.Comments = _comments;
        _model.Status = _status;

        if (ActivityModule.AddRegistration(_model))
        {
            Response.Redirect("RegistrationManagement.aspx");
        }

    }
}
